From: Tim L Date: Fri, 8 Jun 2012 08:26:58 +0000 (+1000) Subject: modalDialog: show dialogs on monitor with the mouse pointer X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6500 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dc004f6eb7c6574e8fa3a5b55e7ef6d51e183479;p=gnome-shell.git modalDialog: show dialogs on monitor with the mouse pointer Show the dialog on the monitor containing the pointer, rather than the monitor with active focused window. This brings it inline with the behaviour seen when launching applications. Remove the focusMonitor/focusIndex from LayoutManager. These properties were only used by the modal dialogs. Remove them since they are not being used elsewhere. https://bugzilla.gnome.org/show_bug.cgi?id=642591 --- diff --git a/js/ui/layout.js b/js/ui/layout.js index 6351ad9eb..ef1a1b2bd 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -228,26 +228,9 @@ const LayoutManager = new Lang.Class({ return false; }, - get focusIndex() { - let focusWindow = global.display.focus_window; - - if (focusWindow) { - let wrect = focusWindow.get_outer_rect(); - for (let i = 0; i < this.monitors.length; i++) { - let monitor = this.monitors[i]; - - if (monitor.x <= wrect.x && monitor.y <= wrect.y && - monitor.x + monitor.width > wrect.x && - monitor.y + monitor.height > wrect.y) - return i; - } - } - - return this.primaryIndex; - }, - - get focusMonitor() { - return this.monitors[this.focusIndex]; + get currentMonitor() { + let index = global.screen.get_current_monitor(); + return Main.layoutManager.monitors[index]; }, _startupAnimation: function() { diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 6109b3293..e30b70596 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -180,7 +180,7 @@ const ModalDialog = new Lang.Class({ }, _fadeOpen: function() { - let monitor = Main.layoutManager.focusMonitor; + let monitor = Main.layoutManager.currentMonitor; this._backgroundBin.set_position(monitor.x, monitor.y); this._backgroundBin.set_size(monitor.width, monitor.height);